using System;
using System.Windows.Controls;

namespace FluentSilverlight.Expressions.Panels
{
    public class OrientationExpression<TParentPart>
    {
        private readonly TParentPart parentPart;
        private readonly Action<Orientation> setOrientation;

        public OrientationExpression(TParentPart parentPart, Action<Orientation> setOrientation)
        {
            this.parentPart = parentPart;
            this.setOrientation = setOrientation;
        }

        public TParentPart Horizontal()
        {
            setOrientation(Orientation.Horizontal);
            return parentPart;
        }

        public TParentPart Vertical()
        {
            setOrientation(Orientation.Vertical);
            return parentPart;
        }
    }
}